﻿<%@ Page Language="C#" MasterPageFile="dao_tao.master" AutoEventWireup="true" CodeFile="CauHinh.aspx.cs" Inherits="App_form_Menu_CauHinh" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div style="width: 500px; height: 240px; position: fixed; top: 200px; left: 500px; border: 1px  #0094ff solid;">
        <div style="width: inherit; background-image: url(../../Images/Hethong/ngang.png); height: 30px;">
            <image src="../../Images/Hethong/login.png" style="width: 23px; height: 24px; float: left; padding: 2px;"></image>
            <div style="text-align: center; padding: 6px; text-transform: uppercase; font-size: 14px; font-weight: bold;">
                Lựa chọn loại hình đào tạo
            </div>
            <div style="padding: 40px 10px 10px 20px;">
                <div style="float: left; width: 25%">
                    <label>Bậc đào tạo :</label>
                </div>
                <div style="width: 75%; float: right; text-align: left;">
                    <Lib:drop runat="server" CssClass="combo panel" ID="BAC" Height="25px" Width="280px" 
                                    DataTextField="TEN" DataValueField="ID" 
                                    onClientChange="P_BAC_CHANG()" />
                </div>
                <br />
                <br />
                <div style="float: left; width: 25%">
                    <label>Hình thức đào tạo :</label>
                </div>
                <div style="width: 75%; float: right; text-align: left;">
                    <Lib:drop runat="server" CssClass="combo panel" ID="HTDT" Height="25px" Width="280px" 
                                    DataTextField="TEN" DataValueField="ID" 
                                    onClientChange="P_HTDT_CHANG()" />
                </div>
                <br />
                <br />
                <div style="float: left; width: 25%">
                    <label>Ngành đào tạo :</label>
                </div>
                <div style="width: 75%; float: right; text-align: left;">
                    <Lib:drop runat="server" CssClass="combo panel" ID="NGANH" Height="25px" Width="280px" 
                                    DataTextField="TEN" DataValueField="ID" />
                </div>
                <br />
                <br />
                <div style="width: 100%; margin-top: 10px; padding-left: 100px;">
                    <Lib:Button runat="server" ID="add" Icon="ADD" Width="100px" Text="Chọn" onClientClick="login();"></Lib:Button>
                </div>
            </div>
        </div>
    </div>
    <asp:HiddenField ID="kthuoc" runat="server" Value="0,0" />
    <script type="text/javascript">
        function P_BAC_CHANG() {
            try {
                var bac = $("#<%=BAC.ClientID%>").val();
                if (bac == "")
                    return;
                wht_nsd.FDT_HTDT_LKE(bac, P_HTDT_LKE_KQ, ErrorDb, ErrorTimeOut);
            }
            catch (e) {
                ShowError(e.message);
            }
        }
        function P_HTDT_LKE_KQ(b_kq) {
            if (CheckError(b_kq)) {
                ShowError(b_kq);
                return;
            }
            var htdt = "<%=HTDT.ClientID%>";
            var a = GetDropByID(htdt);
            a.dataBin(b_kq);
            P_HTDT_CHANG();
        }

        function P_HTDT_CHANG() {
            try {
                var htdt = $("#<%=HTDT.ClientID%>").val();
                if (htdt == "")
                    return;
                wht_nsd.FDT_NGANH_LKE(htdt, P_NGANH_LKE_KQ, ErrorDb, ErrorTimeOut);
            }
            catch (e) {
                ShowError(e.message);
            }
        }
        function P_NGANH_LKE_KQ(b_kq) {
            if (CheckError(b_kq)) {
                ShowError(b_kq);
                return;
            }
            var nganh = "<%=NGANH.ClientID%>";
            var a = GetDropByID(nganh);
            a.dataBin(b_kq);
        }

        function login() {
            try {
                var bac = $("#<%=BAC.ClientID%>").val(),
                 htdt = $("#<%=HTDT.ClientID%>").val(),
                 nganh = $("#<%=NGANH.ClientID%>").val();
                if (Common.isNullOrEmty(bac) || Common.isNullOrEmty(htdt) || Common.isNullOrEmty(nganh)) {
                    Msg.Show("Thông báo", "Không có dữ liệu", "error");
                    return;
                }
                wht_nsd.FDT_CHONCAUHINH_LKE(bac,htdt,nganh, P_CAUHINH_KQ, ErrorDb, ErrorTimeOut);
                return false;
            }
            catch (err) {
                Msg.Show("Thông báo", err.message, "error");
            }
        }
        function P_CAUHINH_KQ(b_kq) {
            if (CheckError(b_kq)) {
                ShowError(b_kq);
                return;
            }
            window.location.assign("menu.aspx");
        }
        </script>
</asp:Content>